package com.scau402.system.service.impl;

import java.util.List;
import com.scau402.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scau402.system.mapper.WmsInventoryMapper;
import com.scau402.system.domain.WmsInventory;
import com.scau402.system.service.IWmsInventoryService;

/**
 * 翡翠库存Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class WmsInventoryServiceImpl implements IWmsInventoryService 
{
    @Autowired
    private WmsInventoryMapper wmsInventoryMapper;

    /**
     * 查询翡翠库存
     * 
     * @param id 翡翠库存主键
     * @return 翡翠库存
     */
    @Override
    public WmsInventory selectWmsInventoryById(Long id)
    {
        return wmsInventoryMapper.selectWmsInventoryById(id);
    }

    /**
     * 查询翡翠库存列表
     * 
     * @param wmsInventory 翡翠库存
     * @return 翡翠库存
     */
    @Override
    public List<WmsInventory> selectWmsInventoryList(WmsInventory wmsInventory)
    {
        return wmsInventoryMapper.selectWmsInventoryList(wmsInventory);
    }

    /**
     * 新增翡翠库存
     * 
     * @param wmsInventory 翡翠库存
     * @return 结果
     */
    @Override
    public int insertWmsInventory(WmsInventory wmsInventory)
    {
        wmsInventory.setCreateTime(DateUtils.getNowDate());
        return wmsInventoryMapper.insertWmsInventory(wmsInventory);
    }

    /**
     * 修改翡翠库存
     * 
     * @param wmsInventory 翡翠库存
     * @return 结果
     */
    @Override
    public int updateWmsInventory(WmsInventory wmsInventory)
    {
        wmsInventory.setUpdateTime(DateUtils.getNowDate());
        return wmsInventoryMapper.updateWmsInventory(wmsInventory);
    }

    /**
     * 批量删除翡翠库存
     * 
     * @param ids 需要删除的翡翠库存主键
     * @return 结果
     */
    @Override
    public int deleteWmsInventoryByIds(Long[] ids)
    {
        return wmsInventoryMapper.deleteWmsInventoryByIds(ids);
    }

    /**
     * 删除翡翠库存信息
     * 
     * @param id 翡翠库存主键
     * @return 结果
     */
    @Override
    public int deleteWmsInventoryById(Long id)
    {
        return wmsInventoryMapper.deleteWmsInventoryById(id);
    }
}
